projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74199a2
)
inifile: Check input file for unicode format.
author
oliskoli
<oliskoli>
Fri, 5 Sep 2008 20:34:37 +0000
(20:34 +0000)
committer
oliskoli
<oliskoli>
Fri, 5 Sep 2008 20:34:37 +0000
(20:34 +0000)
inifile.c
patch
|
blob
|
history
inifile.h
patch
|
blob
|
history
diff --git
a/inifile.c
b/inifile.c
index 84ef67a791028e4a1801ec59634f8fc835d24182..d3b4fc923886f566ddaf7cbb88e74f070e772fb0 100644
(file)
--- a/
inifile.c
+++ b/
inifile.c
@@
-139,10
+139,13
@@
inifile_load_file(gbfile *fin, inifile_t *inifile, const char *myname)
{
char *buf;
inifile_section_t *sec = NULL;
+ int line = 0;
while ((buf = gbfgetstr(fin)))
{
char *cin = lrtrim(buf);
+
+ if ((line++ == 0) && fin->unicode) inifile->unicode = 1;
if (*cin == '\0') continue; /* skip empty lines */
if ((*cin == '#') || (*cin == ';')) continue; /* skip comments */
diff --git
a/inifile.h
b/inifile.h
index 560727732ae3ec5d11e90b8a677598bc6f24faad..e7fc8289f8766044a5bb8a4ec9426d9c53498bf6 100644
(file)
--- a/
inifile.h
+++ b/
inifile.h
@@
-27,6
+27,7
@@
typedef struct inifile_s
{
int isecs; /* number of sections */
queue secs; /* sections */
+ gbuint8 unicode:1;
} inifile_t;
/*